<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改课程包')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-package-edit" th:object="${coursePackage}">
            <input name="id" th:field="*{id}" type="hidden">

            <div class="form-group">    
                <label class="col-sm-3 control-label">课程包名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">类型：</label>
                <div class="col-sm-8"  >
                    <label class="check-box" th:each="dictDataList : ${dictDataList}">
                        <input name="typeName" type="checkbox"  th:text="${dictDataList.dictLabel}"
                               th:value="${dictDataList.dictValue}"  th:checked="${dictDataList.isDefault == 'Y'}">
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">排序：</label>
                <div class="col-sm-8">
                    <input name="orderNum" th:field="*{orderNum}"  class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">课程包描述：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="description" th:field="*{description}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">促销信息：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="promoInfo" th:field="*{promoInfo}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">价格：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="price" th:field="*{price}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">原价：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="originPrice" th:field="*{originPrice}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">目标用户：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="targetUser" th:field="*{targetUser}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">维度：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="dimensions" th:field="*{dimensions}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">标签：</label>
                <div class="col-sm-8">
                    <input name="tags" th:field="*{tags}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">月龄 低限：</label>
                <div class="col-sm-8">
                    <input name="ageLow" th:field="*{ageLow}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">月龄 高限：</label>
                <div class="col-sm-8">
                    <input name="ageHigh" th:field="*{ageHigh}" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">日期前有效：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="input-group date">-->
<!--                        <input name="avaliableDate" th:value="${#dates.format(coursePackage.avaliableDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!--                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">厂商名字：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="vendorName" th:field="*{vendorName}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">封面：</label>
                <div class="col-sm-8">
                    <input name="cover" th:field="*{cover}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/package";
        $("#form-package-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-package-edit').serialize());
            }
        }

        $("input[name='created']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='avaliableDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='lastUpdated']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>